home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 436_01 / indemo.mak < prev    next >
Text File  |  1994-10-07  |  5KB  |  170 lines

  1. #==========================================================================
  2. # INDEMO.MAK
  3. #
  4. # Creates INDEMOx.EXE from object files.
  5. #
  6. # MAKE.EXE doesn't support redirection on ECHO, so this file calls
  7. # INDEMRSP.BAT to create the response file, INDEMO.RSP, required
  8. # by TLINK.  If INDEMRSP.BAT is not available, you can recreate
  9. # it from the following comments.
  10. #
  11. # ::INDEMRSP.BAT
  12. # echo off
  13. # set op=%path%
  14. # path=%1
  15. # for %%x in (INDEMLIB INDEMO) do if "%%x"=="%path%" goto :%%x
  16. # path=%0
  17. # echo %path%.BAT is meant to be called by INDEMLIB.MAK or INDEMO.MAK...
  18. # goto :EXIT
  19. # :INDEMLIB
  20. # echo Creating %1.rsp ...
  21. # echo -+incon    & >  %1.rsp
  22. # echo -+inalpha  & >> %1.rsp
  23. # echo -+infloat  & >> %1.rsp
  24. # echo -+inintgr  & >> %1.rsp
  25. # echo -+intempl  & >> %1.rsp
  26. # echo -+inutil   & >> %1.rsp
  27. # echo -+stringz    >> %1.rsp
  28. # goto :EXIT
  29. # :INDEMO
  30. # for %%x in (s m c l S M C L) do if "%%x"=="%2" goto :OK
  31. # echo Requires memory model (s, m, c, or l)
  32. # goto :EXIT
  33. # :OK
  34. # echo Creating %1.rsp ...
  35. # echo \tc\lib\c0%2+ >  %1.rsp
  36. # echo indemo%2    + >> %1.rsp
  37. # echo inhelp%2    + >> %1.rsp
  38. # echo incon%2     + >> %1.rsp
  39. # echo inalpha%2   + >> %1.rsp
  40. # echo infloat%2   + >> %1.rsp
  41. # echo inintgr%2   + >> %1.rsp
  42. # echo intempl%2   + >> %1.rsp
  43. # echo inutil%2    + >> %1.rsp
  44. # echo addattr    +  >> %1.rsp
  45. # echo stringz       >> %1.rsp
  46. # :EXIT
  47. # path=%op%
  48. # set op=
  49. #==========================================================================
  50. # TCC options are:
  51. #  -c    compile to OBJ
  52. #  -d    merge duplicate strings
  53. #  -f-   no floating point
  54. #  -G    optimize for speed
  55. #  -I    include directories
  56. #  -L    library directories
  57. #  -mx   memory model x
  58. #  -N    check stack overflow
  59. #  -O    jump optimization
  60. #  -o    name object file
  61. #  -r    use register variables
  62. #  -S    compile to ASM
  63. #  -v    source debugging on
  64. #  -w    display all warnings
  65. #  -y    line numbers in OBJ
  66. #  -Z    register optimization
  67. #
  68. # TASM options are:
  69. #  /ml   all symbols case sensitive
  70. #  /t    suppress messages if assembly ok
  71. #  /w2   enable warning messages
  72. #  /z    display source line w/error message
  73. #
  74. # TLINK options are:
  75. #  /c    case significant
  76. #  /d    warn duplicate symbols
  77. #  /m    map file w/public symbols
  78. #  /v    debugging info in .exe file
  79. #==========================================================================
  80.  
  81. # If memory model not defined, use large.
  82.  
  83. !if !$d(MDL)
  84. MDL=l
  85. !endif
  86.  
  87. # Define paths for Turbo C and output directories.  Make changes to these
  88. # constants if your directory structure is set up differently.
  89.  
  90. TCC      = \tc\tcc                     # path to TCC.EXE
  91. TASM     = \tasm\tasm                  # path to TASM.EXE
  92. TLIB     = \tc\tlib                    # path to TLIB.EXE
  93. TLINK    = \tc\tlink                   # path to TLINK.EXE
  94. O_DIR    = \tc\usr\                    # output directory
  95. I_DIR    = \tc\inc;\tc\inc\sys         # include directory
  96. L_DIR    = \tc\lib\                    # library directory
  97. NAME     = indemo$(MDL)
  98.  
  99. # Object and library modules required to make INDEMOx.EXE.
  100.  
  101. OBJS     = @indemo.rsp
  102. LIBS     = $(L_DIR)emu $(L_DIR)math$(MDL) $(L_DIR)c$(MDL)
  103.  
  104. # Compiler, linker, assembler options.
  105.  
  106. !if $d(DEBUG)
  107. C_OPTS   = -c -d -f- -G -I$(I_DIR) -m$(MDL) -N -O -o$& -r -w -v -y -Z
  108. L_OPTS   = /c/d/m/v
  109. !else
  110. C_OPTS   = -c -d -f- -G -I$(I_DIR) -m$(MDL) -O -o$& -r -w -Z
  111. L_OPTS   = /c/d/m
  112. !endif
  113. A_OPTS   = /ml/t/w2/z
  114.  
  115. # Compile and link commands.
  116.  
  117. COMPILE  = $(TCC) $(C_OPTS)
  118. LINK     = $(TLINK) $(L_OPTS)
  119.  
  120. # Common header files.
  121.  
  122. H_FILES  = indecl.h indefs.h
  123.  
  124. # Create INDEMOx.EXE.
  125.  
  126. $(NAME).exe:  $(NAME).obj inhelp$(MDL).obj incon$(MDL).obj            \
  127.               inalpha$(MDL).obj infloat$(MDL).obj inintgr$(MDL).obj   \
  128.               intempl$(MDL).obj inutil$(MDL).obj addattr.obj          \
  129.               stringz.obj
  130.    indemrsp indemo $(MDL)              # call INDEMRSP.BAT
  131.    $(LINK) $(OBJS), $(NAME), $(NAME), $(LIBS)
  132.    del indemo.rsp
  133.  
  134. # The compiler command lines below include a macro defined by
  135. # Borland's MAKE.EXE that allows use of switches stored in
  136. # environment variables.  The macros below all reference an
  137. # environment variable named X, defined by "set x=text_string".
  138.  
  139. $(NAME).obj: indemo.c $(H_FILES)
  140.    $(COMPILE) -f $(X) indemo
  141.  
  142. inhelp$(MDL).obj: inhelp.c $(H_FILES) addattr.h
  143.    $(COMPILE) $(X) inhelp
  144.  
  145. incon$(MDL).obj: incon.c incon.h $(H_FILES) instats.h stringz.h
  146.    $(COMPILE) $(X) incon
  147.  
  148. inalpha$(MDL).obj: inalpha.c incon.h $(H_FILES)
  149.    $(COMPILE) $(X) inalpha
  150.  
  151. infloat$(MDL).obj: infloat.c incon.h $(H_FILES)
  152.    $(COMPILE) $(X) infloat
  153.  
  154. inintgr$(MDL).obj: inintgr.c incon.h $(H_FILES)
  155.    $(COMPILE) $(X) inintgr
  156.  
  157. intempl$(MDL).obj: intempl.c incon.h $(H_FILES)
  158.    $(COMPILE) $(X) intempl.c
  159.  
  160. inutil$(MDL).obj: inutil.c $(H_FILES)
  161.    $(COMPILE) $(X) inutil
  162.  
  163. .asm.obj:
  164.    $(TASM) $(A_OPTS) $<;
  165.  
  166. addattr.obj: addattr.h
  167. stringz.obj: stringz.h
  168.  
  169. #### EOF:  INDEMO.MAK ####
  170.